import request from '@/utils/request'

// 获取机器人列表
export function getRobots(params) {
  return request({
    url: '/robot/list',
    method: 'get',
    params
  })
}

// 获取机器人配置
export function getRobotConfig(robotId) {
  return request({
    url: '/robot/config',
    method: 'get',
    params: { robot_id: robotId }
  })
}

// 更新机器人配置
export function updateRobotConfig(data) {
  return request({
    url: '/robot/config',
    method: 'post',
    data
  })
}

// 获取机器人状态
export function getRobotStatus(robotId) {
  return request({
    url: '/robot/status',
    method: 'get',
    params: { robot_id: robotId }
  })
}

// 获取机器码列表
export function getRobotCodes(params) {
  return request({
    url: '/robot-code',
    method: 'get',
    params
  })
}

// 创建机器码
export function createRobotCodes(data) {
  return request({
    url: '/robot-code',
    method: 'post',
    data
  })
}

// 更新机器码
export function updateRobotCode(data) {
  return request({
    url: '/robot-code',
    method: 'put',
    data
  })
}

// 删除��器码
export function deleteRobotCode(id) {
  return request({
    url: `/robot-code/${id}`,
    method: 'delete'
  })
} 